package com.csyaonie.android;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.Paint;
import android.os.Bundle;
import android.text.Html;
import android.widget.TextView;

public class TextViewActivity extends AppCompatActivity {

    private TextView tv_1;
    private TextView tv_2;
    private TextView tv_3;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text_view);
        tv_1=findViewById(R.id.tv_1);
        tv_1.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);//中划线
        tv_1.getPaint().setAntiAlias(true);//去除锯齿
        tv_2=findViewById(R.id.tv_2);
        tv_2.getPaint().setFlags(Paint.UNDERLINE_TEXT_FLAG);//下划线
        tv_2.getPaint().setAntiAlias(true);//去除锯齿

        tv_3=findViewById(R.id.tv_3);
        tv_3.setText(Html.fromHtml("<u>hello world</u>"));

    }
}